
set more off
cd "${dropbox}/good guys/paper/data_code"

use gbc_s2, clear
append using gbc_s3
append using gbc_s4

sort id Period
gen type=Type[_n+1] if treatment==2

*** For Table in paper
replace profile=. if treatment!=2
bysort id: egen prof=mean(profile)
lab val prof types
gen rred=Type==1
gen red=type==1 if treatment==2

tab profile  if treatment  ==2
tabstat red, by(profi)
tabstat rred if treatment ==4 & study ==4, by(prof)
foreach t of varlist type_* {
	tab `t' red, exact
	}

preserve
	keep if treatment ==4 & study ==4
	collapse (mean) rr, by(id prof)
	forvalues p=1/4 {
		gen pp`p'=prof==`p' if !mi(prof)
		ttest rr, by(pp`p')
		}
restore	

